package com.dcjt.firehotcarpad.fragment

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import com.aries.library.fast.basis.BasisFragment
import com.aries.ui.view.radius.RadiusTextView
import com.dcjt.firehotcarpad.R
import com.dcjt.firehotcarpad.utils.StringUtils

/**
 * Created by cj on 2021/2/20.
 * Email:codesexy@163.com
 * Function:
 * desc:处警页面的左边的水源列表
 */
class WaterTabFragment :  WaterBaseTabsFragment() {

    companion object {
        fun newInstance(zqid:String): WaterTabFragment {
            var fragment = WaterTabFragment()
            val bundle = Bundle()
            bundle.putString("zqid", zqid)
            fragment.setArguments(bundle)
            return fragment
        }
    }
    @SuppressLint("UseRequireInsteadOfGet")
    override fun beforeInitView() {
        zqid = arguments?.getString("zqid").toString()
        super.beforeInitView()
    }
    private var zqid: String = ""

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
    }

    override fun getTabTitles(): List<String> =
        mContext.resources.getStringArray(R.array.arrays_title).toList()


    override fun getFragments(): List<Fragment> {
        return if(!StringUtils.isEmpty(zqid)){
            mutableListOf(
                WaterSourceFragment.newInstance(1)
            )
        }else{
            mutableListOf(
                WaterSourceFragment.newInstance(1),
                WaterSourceFragment.newInstance(2)
            )
        }

    }
}